<?php

class DashboardController extends AppController
{
	public $helpers = array('Html', 'Form');
	
	public function beforeFilter()
	{
		parent::beforeFilter();
		$this->Auth->allow('index');
	}
	
	public function index() {
		//$this->layout = 'dashboard';
		$userId = $this->Auth->user("id");
		
		if($this->Auth->user("role")=="cliente")
		{
			return $this->redirect(array('controller' => 'pages', 'action' => 'homeCliente'));
		}
		if ( $userId == null || $userId == "0")
		{
			return $this->redirect(array('controller'=> 'Users', 'action' => 'index'));
		}
    }
    
}

?>